package com.lzc.springMvcPart;

import com.lzc.springMvcPart.annotation.Json;
import com.lzc.springMvcPart.annotation.Token;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class TestController {

    @GetMapping("/hello")
    @Json //自定义返回值处理器
    public User hello(){
        System.out.println("hello");
        return new User("zhangsan","10001");
    }

    @PostMapping("/args")
    public void args(@RequestParam("args") String args){
        System.out.println("args = " + args);
    }

    @GetMapping("/getToken")
    public void getToken(@Token String token){
        System.out.println("token is " + token);
    }
}
